package com.gyg.controller;

import com.gyg.service.ThreadPoolService;
import com.gyg.service.ThreadPoolService2;
import com.gyg.service.ThreadPoolService3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableAsync
public class ThreadPoolController {
    @Autowired
    private ThreadPoolService threadPoolService;
    @Autowired
    private ThreadPoolService2 threadPoolService2;
    @Autowired
    private ThreadPoolService3 threadPoolService3;

    @GetMapping("/threadPoolTest")
    public void threadPoolTest() {
        threadPoolService.executeAsync();
        threadPoolService2.executeAsync2();
    }

    @GetMapping("/threadPoolTest2")
    public void threadPoolTest2() {
        threadPoolService3.executeAsync3();
        threadPoolService3.executeAsync4();
    }
}
